<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<script src="https://unpkg.com/vue@next">
</script>

<div id="app">
    <todo-item v-bind:init-data="initData"></todo-item>
</div>

<script>
    const vueOpt = {
        data(){
            return {
                initData: 2
            }
        },
    }

    const app = Vue.createApp(vueOpt);

    app.component('todo-item', {
        data(){
            return {
                curData: this.initData
            }
        },
        props: ['initData'],
        template: `
            <div>{{curData}}</div>
        `,
        created(){
            setInterval(()=>{
                this.curData *=2;
            }, 1000);
        }
    })

    app.mount('#app')


</script>
</body>
</html>
